#!/bin/bash -l

# Note: A line of the form "#$ qsub_option" is interpreted
# by qsub as if "qsub_option" was passed to qsub on
# the commandline. A line of the form "# COMMENT" is
# interpreted as a comment.
# Set the runtime limit to 2 hours
#$ -l h_rt=48:00:00
# Set memory resources
#$ -l mem_per_core=16G
# Set to omp parallel environment with 16 processors(or 28, 36)
#$ -pe omp 36
# Merge output files to reduce clutter
#$ -j y
# Name the standard output and error file
#$ -o log
# Name your job
#$ -N Inf_11378_time
# Email me when finish
# -m ea
# Specify the range of tasks $SGE_TASK_ID
# -t 78-113

echo "=========================================================="
echo "Starting on : $(date)"
echo "Running on node : $(hostname)"
echo "Current directory : $(pwd)"
echo "Current job ID : $JOB_ID"
echo "Current job name : $JOB_NAME"
echo "Task index number : $SGE_TASK_ID"
echo "=========================================================="
# Run the job. Here, example.R is the name of the .R file. Input: gender, from.year, to.year
module load R/3.3.2
echo "Number of Bootstrap = $1, Counterfactual Method = $2, Rho's Specification = $3, Sample = $4"
Rscript DRS_Emp_Inf.R $1 $2 $3 $4
echo "=========================================================="
echo "Finished on : $(date)"
echo "=========================================================="
